import { useCounterStore } from '@/pinia/pinia';
import { isNullPm } from '@/utils/baseMethods';

/**
 * 有问题需修复
 * @param to
 * @returns
 */
const befroeSrart = (to: any): any => {
  /**
   * @routerList 所有无权限路由必须在这边注册过
   */

  const userInFo: any = useCounterStore();
  // if (userInFo.getGm() ? isNullPm(userInFo.getGm().token) : true) {
  //   if (to.fullPath.indexOf('login') == -1) {
  //     return { path: '/login' };
  //   }
  // } else {
  //   if (to.fullPath.indexOf('login') != -1) return { path: '/home' };
  //   else if (to.fullPath == '/') return { path: '/home' };
  //   else return true;
  // }
};

export default befroeSrart;
